const http = require('http');
const fs = require('fs');
http.createServer((req, res) => {
    const urlString = req.url
    console.log('urlString---', urlString);

    switch (urlString) {
        case '/':
            res.end('hello')
            break;
        case '/home':
            fs.readFile('./home.html', function (err, data) {
                res.end(data)
            });
            break;
        case '/app.js':
            fs.readFile('./app.js', function (err, data) {
                res.end(data)
            });
            break;
        default:
            res.end('404')
    }
}).listen(8080);


